package com.kun.dao.impl;


import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Repository;

import com.kun.dao.RegistDao;
import com.kun.entity.CustomerEntity;

@Repository("RegistDaoImpl")
public class RegistDaoImpl implements RegistDao {

	public String regist(CustomerEntity customerEntity) {
		ApplicationContext app = new ClassPathXmlApplicationContext("applicationContext.xml");
		SessionFactory sf = (SessionFactory) app.getBean("sessionFactory");
		Session session = sf.openSession();
		session.save(customerEntity);
		return "success";
	}

}
